package com.dx.wx.controller;

import com.dx.wx.service.DxActService;
import com.dx.wx.service.DxSaleService;
import com.dx.wx.service.DxUserService;
import com.ejlchina.data.Array;
import com.yf.annotation.LoginUserId;
import com.yf.response.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/api/dx/sale")
public class ApiDxSaleController {

    @Resource
    private DxSaleService dxSaleService;

    @Resource
    private DxUserService dxUserService;



    @GetMapping("/list")
    public R list(@LoginUserId Long phone, Long startDate, Long endDate,String appId) {
        Array array = dxSaleService.list( startDate, endDate,phone);
        Array topList =  dxUserService.findByTop(Long.valueOf(phone),appId);
        return R.ok(array.toString()).putExtra("topList",topList.toString());
    }


}
